package alitaV.old;

import org.apache.commons.lang3.RandomStringUtils;
import org.apache.commons.lang3.RandomUtils;

import java.lang.reflect.Field;

public class   v {
    public static void main(String[] args)throws Exception {
        System.out.println(v.class);
        gen(alita.class);
    }
    public  static <X> X gen(Class<X> s) throws Exception {


             X u = s.newInstance();
           Field[] declaredFields=s.getDeclaredFields();
            for ( Field field : declaredFields)
            {
                Class<?> type = field.getType();
                field.setAccessible(true);
                if (type.isAssignableFrom(String.class)) {
                    field.set(u, RandomStringUtils.randomAlphabetic(3));
                }
                if (type.isAssignableFrom(Double.class)) {
                    field.set(u, RandomUtils.nextDouble());
                }

            }
                return u;
    }
}
class alita {
    private String name;


    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getAddr() {
        return addr;
    }

    public void setAddr(String addr) {
        this.addr = addr;
    }

    private String addr;



}
class yugo {

    private Double addr;
}
